package com.zdy.demo2;

/**
 * @author deyou
 * @version 1.0
 * @date 2021/5/21 9:52
 */

public class FactorialDemo {
    public static int factorial(int n){
        if(n <=1){
            return 1;
        }
        return n * factorial(n-1);
    }

    public static void main(String[] args) {
        System.out.println(factorial(5));
    }
}
